bitkeeper revision 1.1472.2.6 (42916b37WTfslw9tSflk_BS_9JVW1Q)
authoradsharma@linux-t08.sc.intel.com <adsharma@linux-t08.sc.intel.com>
Mon, 23 May 2005 05:33:43 +0000 (05:33 +0000)
committeradsharma@linux-t08.sc.intel.com <adsharma@linux-t08.sc.intel.com>
Mon, 23 May 2005 05:33:43 +0000 (05:33 +0000)
vmx_vcpu.h, vmx_phy_mode.c, mkbuildtree, domain.c, Makefile:
  Fix VT-i build

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
xen/arch/ia64/Makefile
xen/arch/ia64/domain.c
xen/arch/ia64/tools/mkbuildtree
xen/arch/ia64/vmx_phy_mode.c
xen/include/asm-ia64/vmx_vcpu.h

index 6c0e371fc4a61f1ada2f1eb062974a9334781398..fdb9fbe1b9d0c7dd5bf8a4f906a6a0d9ae4b263f 100644 (file)
@@ -30,9 +30,22 @@ default: $(OBJS) head.o ia64lib.o xen.lds.s
                -Map map.out head.o $(ALL_OBJS) -o $(TARGET)-syms
        $(OBJCOPY) -R .note -R .comment -S $(TARGET)-syms $(TARGET)
 
-asm-offsets.s: asm-offsets.c
+asm-offsets.s: asm-offsets.c $(BASEDIR)/include/asm-ia64/.offsets.h.stamp
        $(CC) $(CFLAGS) -S -o $@ $<
 
+$(BASEDIR)/include/asm-ia64/.offsets.h.stamp:
+# Need such symbol link to make linux headers available
+       [ -e $(BASEDIR)/include/linux ] \
+        || ln -s $(BASEDIR)/include/xen $(BASEDIR)/include/linux
+       [ -e $(BASEDIR)/include/asm-ia64/xen ] \
+        || ln -s $(BASEDIR)/include/asm-ia64/linux $(BASEDIR)/include/asm-ia64/xen
+# Solve circular reference on asm-offsets.h
+       [ -f $(BASEDIR)/include/asm-ia64/asm-offsets.h ] \
+        || echo "#define IA64_TASK_SIZE 0" > $(BASEDIR)/include/asm-ia64/asm-offsets.h
+#Bad hack. Force asm-offsets.h out-of-date
+        sleep 1
+        touch $@
+
 # I'm sure a Makefile wizard would know a better way to do this
 xen.lds.s: xen.lds.S
        $(CC) -E $(CPPFLAGS) -P -DXEN -D__ASSEMBLY__ \
@@ -42,9 +55,8 @@ ia64lib.o:
        $(MAKE) -C lib && cp lib/ia64lib.o .
 
 clean:
-       rm -f *.o *~ core  xen.lds.s $(BASEDIR)/include/asm-ia64/.offsets.h.stamp
+       rm -f *.o *~ core  xen.lds.s $(BASEDIR)/include/asm-ia64/.offsets.h.stamp asm-offsets.s
        rm -f lib/*.o
-       $(MAKE) -C lib clean
 
 # setup.o contains bits of compile.h so it must be blown away
 delete-unfresh-files:
index deee1321f9226f3d63d491dd050890bf7ca590a4..8f12179c5dfba361d5096fc733513550f2044850 100644 (file)
@@ -40,6 +40,7 @@
 #ifdef CONFIG_VTI
 #include <asm/vmx.h>
 #include <asm/vmx_vcpu.h>
+#include <asm/pal.h>
 #endif // CONFIG_VTI
 
 #define CONFIG_DOMAIN0_CONTIGUOUS
@@ -792,13 +793,15 @@ int construct_dom0(struct domain *d,
     unsigned long pkern_start;
     unsigned long pkern_entry;
     unsigned long pkern_end;
+    unsigned long ret;
+    unsigned long progress = 0;
 
 //printf("construct_dom0: starting\n");
     /* Sanity! */
 #ifndef CLONE_DOMAIN0
     if ( d != dom0 ) 
         BUG();
-    if ( test_bit(DF_CONSTRUCTED, &d->flags) ) 
+    if ( test_bit(_DOMF_constructed, &d->domain_flags) ) 
         BUG();
 #endif
 
@@ -888,14 +891,11 @@ int construct_dom0(struct domain *d,
     /* Copy the initial ramdisk. */
 
     /* Sync d/i cache conservatively */
-    {
-        unsigned long ret;
-        unsigned long progress;
-        ret = ia64_pal_cache_flush(4, 0, &progress, NULL);
-        if (ret != PAL_STATUS_SUCCESS)
-                panic("PAL CACHE FLUSH failed for dom0.\n");
-        printk("Sync i/d cache for dom0 image SUCC\n");
-    }
+    ret = ia64_pal_cache_flush(4, 0, &progress, NULL);
+    if (ret != PAL_STATUS_SUCCESS)
+            panic("PAL CACHE FLUSH failed for dom0.\n");
+    printk("Sync i/d cache for dom0 image SUCC\n");
+
     /* Physical mode emulation initialization, including
      * emulation ID allcation and related memory request
      */
@@ -919,8 +919,8 @@ int construct_dom0(struct domain *d,
     /* vpd is ready now */
     vlsapic_reset(ed);
     vtm_init(ed);
-    set_bit(DF_CONSTRUCTED, &d->flags);
 
+    set_bit(_DOMF_constructed, &d->domain_flags);
     new_thread(ed, pkern_entry, 0, 0);
 
     // FIXME: Hack for keyboard input
index 34ff02fa9439ce90f11cc3154d22ddf145fcd711..f9b58527dd63947b3cb81cfff1ea5090f8344ee5 100644 (file)
@@ -46,13 +46,13 @@ mkdir include/asm-generic
 mkdir include/asm-ia64/linux
 mkdir include/asm-ia64/linux/byteorder
 # use "gcc -Iinclude/asm-ia64" to find these linux includes
-ln -s $XEN/include/xen $XEN/include/linux
-ln -s $XEN/include/asm-ia64/linux $XEN/include/asm-ia64/xen 
+#ln -s $XEN/include/xen $XEN/include/linux
+#ln -s $XEN/include/asm-ia64/linux $XEN/include/asm-ia64/xen 
 
 # prepare for building asm-offsets (circular dependency)
-echo '#define IA64_TASK_SIZE 0' > include/asm-ia64/asm-offsets.h
-sleep 2
-touch arch/ia64/asm-offsets.c
+#echo '#define IA64_TASK_SIZE 0' > include/asm-ia64/asm-offsets.h
+#sleep 2
+#touch arch/ia64/asm-offsets.c
 
 # patches to xen/common files
 #xen_patch common/domain.c domain.c
index 938cfeb051f20d52869db4634264d2b962da9ab2..def87baf9e9a303b716ad9719e82a4982acf02e8 100644 (file)
@@ -104,7 +104,7 @@ physical_mode_init(VCPU *vcpu)
     UINT64 psr;
     struct domain * d = vcpu->domain;
 
-    vcpu->domain->arch.emul_phy_rr0.rid = XEN_RR7_RID+((d->id)<<3);
+    vcpu->domain->arch.emul_phy_rr0.rid = XEN_RR7_RID+((d->domain_id)<<3);
     /* FIXME */
 #if 0
     vcpu->domain->arch.emul_phy_rr0.ps = 28;  /* set page size to 256M */
@@ -112,7 +112,7 @@ physical_mode_init(VCPU *vcpu)
        vcpu->domain->arch.emul_phy_rr0.ps = EMUL_PHY_PAGE_SHIFT;  /* set page size to 4k */
     vcpu->domain->arch.emul_phy_rr0.ve = 1; /* enable VHPT walker on this region */
 
-    vcpu->domain->arch.emul_phy_rr4.rid = XEN_RR7_RID + ((d->id)<<3) + 4;
+    vcpu->domain->arch.emul_phy_rr4.rid = XEN_RR7_RID + ((d->domain_id)<<3) + 4;
     vcpu->domain->arch.emul_phy_rr4.ps = EMUL_PHY_PAGE_SHIFT;  /* set page size to 4k */
     vcpu->domain->arch.emul_phy_rr4.ve = 1; /* enable VHPT walker on this region */
 
index 59966d1c7c6d1d6ddab94bc5089d37611e87f26a..dc4e0977b7dfe1afe6620ffd709fe5b96ed7b6e0 100644 (file)
@@ -54,7 +54,7 @@
 #define VMM_RR_SHIFT    20
 #define VMM_RR_MASK     ((1UL<<VMM_RR_SHIFT)-1)
 #define VRID_2_MRID(vcpu,rid)  ((rid) & VMM_RR_MASK) | \
-                ((vcpu->domain->id) << VMM_RR_SHIFT)
+                ((vcpu->domain->domain_id) << VMM_RR_SHIFT)
 extern u64 indirect_reg_igfld_MASK ( int type, int index, u64 value);
 extern u64 cr_igfld_mask (int index, u64 value);
 extern int check_indirect_reg_rsv_fields ( int type, int index, u64 value );
@@ -590,7 +590,7 @@ vmx_vrrtomrr(VCPU *vcpu,unsigned long val)
     ia64_rr rr;
     u64          rid;
     rr.rrval=val;
-    rid=(((u64)vcpu->domain->id)<<DOMAIN_RID_SHIFT) + rr.rid;
+    rid=(((u64)vcpu->domain->domain_id)<<DOMAIN_RID_SHIFT) + rr.rid;
     rr.rid = redistribute_rid(rid);
     rr.ve=1;
     return rr.rrval;